/*
*	(*^。^*) TFrameWork License (*^。^*)
*/

/*
 *  Title :  
 *          
 *  Description :  
 *          
 *          
 *  Date : 
 *
 *  Author : DengPing
 *
 *  Modify : 
 */

namespace TFrameWork.Module.ActionEditor
{
    public class GameObjectTrack : TrackBase
    {
        protected override string trackName => "预制体轨道";
        protected override TrackStyleBase _trackStyle { get; set; }

        /// <summary>
        /// 信号轨道数据
        /// </summary>
        public TrackData trackData => ActionEditor.Instance.ActionData.GetTrackList<PrefabEvent>();
        

        /// <summary>
        /// 检查是否可以删除子轨道
        /// </summary>
        /// <returns></returns>
        private bool CheckDeleteChildTrack(int index)
        {
            return true;
        }

        /// <summary>
        /// 检查添是否可以加子轨道
        /// </summary>
        /// <returns></returns>
        private bool CheckAddChildTrack()
        {
            return true;
        }

        public override void ResetLoadTrack()
        {
            // 销毁当前已有
            Destroy();

            // 根据数据绘制轨道UI样式
            var particleTrackStyle = new GameObjectTrackStyle();
            _trackStyle = particleTrackStyle;
            particleTrackStyle.Init(menuParent, trackParent, this, trackData, trackName, CheckAddChildTrack,
                CheckDeleteChildTrack);
        }
    }
}
